<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <title>员工加班记录</title>
    <script type="text/javascript" src="../../../js/boot.js"></script>

</head>
<body>
<div class="mini-fit">
    <div id="datagrid" class="mini-datagrid" style="width:100%;height:100%;" pageSize="20" idField="instID" allowResize="true" multiSelect="true">
        <div property="columns">
            <div type="indexcolumn" width="20"></div>
            <div type="checkcolumn" width="20"></div>
            <div field="userName" headerAlign="center" width="80">姓名</div>
            <div field="dataType" headerAlign="center" width="80">加班类型</div>
            <div field="calendarDate" dateFormat="yyyy-MM-dd" headerAlign="center" width="120">加班日期</div>
            <div field="startTime" dateFormat="yyyy-MM-dd HH:mm:ss" headerAlign="center" width="120">开始时间</div>
            <div field="endTime" dateFormat="yyyy-MM-dd HH:mm:ss" headerAlign="center" width="120">结束时间</div>
            <div field="workTime" headerAlign="center" width="80">加班时长</div>
            <div field="description" headerAlign="center" width="160">加班描述</div>

        </div>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
    mini.parse();

    var userID;
    var url=window.location.search; //获取url中"?"符后的字串
    if(url.indexOf("?")!=-1){
        url = url.substr(url.indexOf("=")+1);
        if(url.indexOf("&")!=-1){
            url = url.split("&")[0];
        }
    }
    userID = url;

    var datagrid = mini.get("datagrid"); // 表定义列表
    datagrid.set({
        url: http.getUrl("/oa/overtime/getWorkOverTimeRecordList.do?userID="+userID)
    });
    datagrid.load();

    datagrid.on("drawcell",function(e) {
        var record = e.record, column = e.column, field = e.field, value = e.value;
        if(field=="dataType"&&value!=null){
            e.cellHtml =  common.getDetail(CONST.get('overTimeTypes'),"id",value).text;
        }
    });
</script>